﻿using System.Text;
using System.Web;

namespace K3R.Web.Extensions {
	public static class StringExtension {
		public static string WithParagraphs(this string value) {
			var builder = new StringBuilder();

			var arr = value.Split(new char[] { '\n' });
			foreach (var paragraph in arr)
				builder.AppendFormat("<p>{0}</p>", HttpUtility.HtmlEncode(paragraph));

			return builder.ToString();
		}
	}
}
